package com.example.demo01.service.Impl;

import com.example.demo01.eneity.YzfCompetition;
import com.example.demo01.eneity.YzfUser;
import com.example.demo01.mapper.YzfCompetionMapper;
import com.example.demo01.service.YzfCompetitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
// 注入YzfCompetionMapper
public class YzfCompetitionServiceImpl implements YzfCompetitionService {

    @Autowired
    private YzfCompetionMapper yzfCompetionMapper;


    // 获取比赛列表
    @Override
    public List<YzfCompetition> getCompetitions() {
        return yzfCompetionMapper.getCompetitions();
    }

    // 获取比赛列表和类别
    @Override
    public List<YzfCompetition> getAllCompetitionsWithCategories() {
        return yzfCompetionMapper.getAllCompetitionsWithCategories();
    }

    // 获取比赛评委
    @Override
    public List<YzfUser> getCompetitionJudges(int competitionId) {
        return yzfCompetionMapper.getCompetitionJudges(competitionId);
    }


}
